from ultralytics import YOLO

model = YOLO("yolov8n.pt")

results = model.train(data="data.yaml", epochs=300, batch=32, device=0, imgsz=640, workers=0)